//
//  CustomView.m
//  CAShapeLayer
//
//  Created by Xwoder on 17/2/1.
//  Copyright © 2017年 Xwoder. All rights reserved.
//

#import "CustomView.h"

@implementation CustomView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor lightGrayColor];
    }
    return self;
}

- (void)drawRect:(CGRect)rect {
    
    UIBezierPath* path = [UIBezierPath bezierPath];
    
    path.lineWidth = 10;
    path.lineCapStyle = kCGLineCapRound;
    
    [path moveToPoint:CGPointMake(10, 10)];
    [path addLineToPoint:CGPointMake(rect.size.width - 10, rect.size.height - 10)];
    
    [[UIColor yellowColor] setStroke];

    [path stroke];
}


@end
